#! /usr/bin/env python

from dynamic_reconfigure.parameter_generator_catkin import *
"""
    动态参数客户端：
        1.导包
        2.创建一个参数生成器
        3.往生成器添加参数
        4.配置节点，并退出
"""
# 2.创建一个参数生成器
gen = ParameterGenerator()
# 3.往生成器添加参数
# add(name: Any,paramtype: Any,level: Any,description: Any,default: Any | None = None,
#     min: Any | None = None,max: Any | None = None,edit_method: str = "")
gen.add("int_param",int_t,0,"整数参数",10,1,100)
gen.add("double_param",double_t,0,"浮点参数",1.57,0,3.14)
gen.add("str_param",str_t,0,"字符串参数","hello_param")
gen.add("bool_param",bool_t,0,"布尔参数",True)
myList=gen.enum([gen.const("small",int_t,0,"small car"),
                 gen.const("normal",int_t,1,"normal car"),
                 gen.const("big",int_t,2,"big car")],
                 "car_size")
gen.add("list_param",int_t,0,"列表参数",0,0,2,edit_method=myList)
# 4.配置节点，并退出
# generate(
#     pkgname: Any,
#     nodename: Any,
#     name: Any
# )
exit(gen.generate("demo02_dr","dr_client","dr"))
